import request from "../utils/request";
import {LocationQuery, LocationQueryValue} from "vue-router";

interface ResponseData<T = any> {
    status: number,
    msg: string,
    data: T
}
export const getWebsite=()=>{
    return request.get<ResponseData<[{
        id:number,
        name:string,
        icon:string,
        web_description:string,
        website:string,
        tags:string,
    }]>>('/getWebsite').then(res=>{
        return res.data
    })
}

export const getWebsiteDetailPage=(websiteId:LocationQueryValue|LocationQueryValue[])=>{
    return request.get<ResponseData<{
        id:number,
        name:string,
        icon:string,
        web_description:string,
        website:string,
        tags:string,
        details:'',
        create_time:'',
        create_name:''
    }>>(`/getWebsiteDetailPage/${websiteId}`).then(res=>{
        return res.data

    })
}
export const getChecked=(data:string[])=>{
    return request.post('/getChecked',data).then(res=>{
        return res.data
    })
}